package demo7;

import org.springframework.context.annotation.AnnotationConfigApplicationContext;

public class Demo {
    public static void main(String[] args) {
        System.out.println("spring容器正在初始化..");
        AnnotationConfigApplicationContext context =
                new AnnotationConfigApplicationContext("demo7");
        System.out.println("spring容器初始化完毕");
        System.out.println("spring容器获取person对象");
        Person bean = context.getBean(Person.class);
        System.out.println("获取person对象完毕");
        bean.play();
        System.out.println("spring容器关闭中");
        context.close();
        System.out.println("spring容器已关闭");

    }
}
